<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>综合评教</title>
		<link rel="stylesheet" href="../../statics/layui/css/layui.css">
		<link href="../../css/criterion/main.css" rel="stylesheet" type="text/css" />
		<link href="../../css/criterion/iconfont.css" rel="stylesheet" type="text/css" />
		<link href="../../css/criterion/test.css" rel="stylesheet" type="text/css" />
	</head>

	<body>
		<div class="main">
			<!--nr start-->
			<div class="test_main">
				<!--<div class="layui-card-header">
					<span class="layui-col-md-offset10 layui-col-sm-offset11 layui-col-xs-offset10">
						<button type="button" id="refresh" title="刷新" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-refresh"></i></button>
					</span>
				</div>-->
				<div class="test">
					<form action="" method="post">
						<div class="test_title">
							<label><input type="button" name="refresh" id="refresh" value="刷新"></label>
							<font><input type="button" name="tijiao" value="返回" id="t_fanhui"></font>
						</div>
						<!--<div class="test_content">
						</div>-->
						<div class="test_content_nr" id="addEvacontents">
							<!--<ul id="addEvacontent">
							</ul>-->
						</div>
					</form>
				</div>
			</div>
			<!--nr end-->
			<div class="foot"></div>
		</div>
		<script src="../../statics/layui/layui.js"></script>
		<script src="../../statics/jquery/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../statics/lay/system/admin/public.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../statics/lay/system/admin/public_eva.js" type="text/javascript" charset="utf-8"></script>
		<script>
			layui.use(['rate', 'layer'], function() {
				var rate = layui.rate,
					layer = layui.layer;
				var $ = layui.jquery;
				var isum = 1;
				var html;

				var tId = getUrlParam("tId"); // 获取上一页面传来的tid
				var cId = getUrlParam("cId"); // 获取上一页面传来的cid
				var fromdata = {
					tId: tId,
					cId: cId
				};
				layer.load();
				setTimeout(function() {
					layer.closeAll('loading');
				}, 800);
				initData()
				fandMyfen(fromdata); //查询题目

				// 返回评价列表
				$("#t_fanhui").on('click', function() {
					parent.layer.closeAll();
					//parent.location.reload(); //刷新父页面
				})
				//	动态添加页面
				function addEvaContent(data) {
					//parseJson(data)
					GetDataDetails({
						children: data
					}, null);
					$('#addEvacontents').append(menus);
				}
				
			// 请求 题目数据
			function initData() {
				$.ajax({
					type: "get",
					url: IP + "/api/teacher_eav/evaluate/teacher",
					async: false,
					success: function(data) {
						addEvaContent(data);
					}
				});
			}

			// 请求 分数
			function fandMyfen(fromdata) {
				$.ajax({
					type: "POST",
					contentType: "application/json; charset=utf-8",
					url: IP + "/api/teacher_eav/teacherLogin/mydetial",
					data: JSON.stringify(fromdata),
					dataType: "json",
					async: false,
					success: function(data) {
						//layer.closeAll('loading');
						addMyfenTeacher(data);
					}
				});
			}
			//				// 遍历解析Json
			//				function parseJson(jsonObj) {
			//					$.each(jsonObj, function(i, objec) {
			//						if(objec.children.length > 0) {
			//							parseJson(objec.children);
			//						} else {
			//							html = '<li class="test_content_hcontt">' +
			//								'<div class="test_content_nr_tt">' +
			//								'<i>' + (isum++) + '</i>' +
			//								'<font class="layui-col-sm4">' + objec.eTitle + '<span class="xingzong">( 4 星)</span></font>' +
			//								'<span class="layui-col-sm-offset4 mypinjia">我的评价：<span class="myfen"></span>星 </span>' +
			//								'<div class="eva_item" data-id=' + objec.eId + '></div>' +
			//								'</div>' +
			//								'<div class="test_content_nr_main">' +
			//								'</div>' +
			//								'</li>';
			//							$('#addEvacontent').append(html);
			//						}
			//					});
			//				}
			
			
			//				$('#addEvacontent').on('click', '.eva_item li', function() {
				//					//获取选择的星星个数
				//					var x_number = $(this).siblings().children('i.layui-icon-rate-solid').length + 1;
				//					//获取 后台传来的题id
				//					var tp_id = $(this).parents(".eva_item").attr('data-id');
				//					//存数据
				//					createdata.put(tp_id, x_number);
				//				});
			});
		</script>
	</body>

</html>